package com.iotechn.unimall.admin.api.equipment;

import com.dobbinsoft.fw.core.annotation.HttpMethod;
import com.dobbinsoft.fw.core.annotation.HttpOpenApi;
import com.dobbinsoft.fw.core.annotation.HttpParam;
import com.dobbinsoft.fw.core.annotation.HttpParamType;
import com.dobbinsoft.fw.core.annotation.param.NotNull;
import com.dobbinsoft.fw.core.exception.ServiceException;
import com.dobbinsoft.fw.support.model.Page;
import com.iotechn.unimall.data.domain.EquipmentDO;

import java.util.List;

/**
 * Generate Code By Unimall
 */
@HttpOpenApi(group = "admin.equipment", description = "unimall_equipmentService")
public interface equipmentService {

    @HttpMethod(description = "删除", permission = "equipmentManage:equipment:delete", permissionParentName = "其他", permissionName = "equipment")
    public boolean delete(
            @NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "id") Long id,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;

    @HttpMethod(description = "查询", permission = "equipmentManage:equipment:list", permissionParentName = "其他", permissionName = "equipment")
    public Page<EquipmentDO> list(
            @HttpParam(name = "searchKeyWord", type = HttpParamType.COMMON, description = "模糊查询") String searchKeyWord,
            @HttpParam(name = "type", type = HttpParamType.COMMON, description = "设备状态") String type,//（1正常,2异常,3弃用）
            @HttpParam(name = "room", type = HttpParamType.COMMON, description = "机房") String room,
            @HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
            @HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "20") Integer limit,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;

    @HttpMethod(description = "添加", permission = "equipmentManage:equipment:create", permissionParentName = "其他", permissionName = "equipment")
    public EquipmentDO create(
            @NotNull @HttpParam(name = "equipmentType", type = HttpParamType.COMMON, description = "设备类型") String equipmentType,
            @NotNull @HttpParam(name = "equipmentNo", type = HttpParamType.COMMON, description = "设备编号") String equipmentNo,
            @NotNull @HttpParam(name = "roomName", type = HttpParamType.COMMON, description = "所属机房") String roomName,
            @NotNull @HttpParam(name = "roomId", type = HttpParamType.COMMON, description = "机房Id") Long roomId,
            @NotNull @HttpParam(name = "inspectionItems", type = HttpParamType.COMMON, description = "检查事项") String inspectionItems,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;

    @HttpMethod(description = "编辑", permission = "equipmentManage:equipment:edit", permissionParentName = "其他", permissionName = "equipment")
    public String edit(
            @NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "主键") Long id,
            @NotNull @HttpParam(name = "equipmentType", type = HttpParamType.COMMON, description = "设备类型") String equipmentType,
            @NotNull @HttpParam(name = "equipmentNo", type = HttpParamType.COMMON, description = "设备编号") String equipmentNo,
            @NotNull @HttpParam(name = "roomName", type = HttpParamType.COMMON, description = "所属机房") String roomName,
            @NotNull @HttpParam(name = "roomId", type = HttpParamType.COMMON, description = "roomId") Long roomId,
            @NotNull @HttpParam(name = "inspectionItems", type = HttpParamType.COMMON, description = "检查事项") String inspectionItems,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;

    @HttpMethod(description = "启用/弃用", permission = "equipmentManage:equipment:discard", permissionParentName = "其他", permissionName = "equipment")
    public String discard(
            @NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "主键") Long id,
            @NotNull @HttpParam(name = "flag", type = HttpParamType.COMMON, description = "标识（1启用2弃用）") String flag,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;

    @HttpMethod(description = "设备下拉列表", permission = "equipmentManage:equipment:xiaList", permissionParentName = "其他", permissionName = "equipment")
    public List<EquipmentDO> xiaList(
            @HttpParam(name = "roomName", type = HttpParamType.COMMON, description = "机房") String roomName,
            @HttpParam(name = "equipmentType", type = HttpParamType.COMMON, description = "设备类型") String equipmentType,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;

    @HttpMethod(description = "首页折线图", permission = "equipmentManage:equipment:chart", permissionParentName = "其他", permissionName = "equipment")
    public EquipmentDO chart(
            @HttpParam(name = "roomId", type = HttpParamType.COMMON, description = "机房id") String roomId,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;

    @HttpMethod(description = "生成二维码", permission = "equipmentManage:equipment:createCode", permissionParentName = "其他", permissionName = "equipment")
    public String createCode(
            @HttpParam(name = "id", type = HttpParamType.COMMON, description = "id") String id,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;
}
